package obecto.task
{
	public class BasePausableTask extends BaseInterruptibleTask implements IPausableTask
	{
		
		private var _paused:Boolean;
		
		public function BasePausableTask()
		{
			super();
		}
		
		public function get paused():Boolean
		{
			return _paused;
		}
		public function set paused(value:Boolean):void
		{
			if (_paused != value)
			{
				_paused = value;
				if (_paused)
				{
					pause();
				}
				else
				{
					resume();
				}
			}
		}
		
		protected function pause():void
		{
			interrupt();
		}
		
		protected function resume():void
		{
			start();
		}
	}
}